﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Motoball.screenmanager;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace Motoball.screens
{
    class MaxScoreScreen : OptionsSelectScreen
    {
        public MaxScoreScreen(string screenName)
            : base(screenName)
        {           
        }

        #region Methods
        public override void LoadContent()
        {
            ContentManager content = screenManager.Content;
            
            //AddItem("Models\\5");
            //AddItem("Models\\10");
            //AddItem("Models\\15");
            //AddItem("Models\\20");
            //AddItem("Models\\30");
            AddItem(new MenuItem(new BasicModel(screenManager.Content.Load<Model>("Models\\10"))));
            AddItem(new MenuItem(new BasicModel(screenManager.Content.Load<Model>("Models\\15"))));
            AddItem(new MenuItem(new BasicModel(screenManager.Content.Load<Model>("Models\\20"))));
            AddItem(new MenuItem(new BasicModel(screenManager.Content.Load<Model>("Models\\30"))));

            items[0].model.World = Matrix.Identity;
            foreach (MenuItem item in items)
                item.scaleFactor *= 3.5f;
     
            TopItem = 0;
            Reset();
        }
        
        protected override bool DoSomething()
        {
            switch (TopItem)
            {
                //case 0:
                //    ContentStorage.ScoreLimit = 5;
                //    return true;
                //case 1:
                //    ContentStorage.ScoreLimit = 10;
                //    return true;
                //case 2:
                //    ContentStorage.ScoreLimit = 15;
                //    return true;
                //case 3:
                //    ContentStorage.ScoreLimit = 20;
                //    return true;
                //case 4:
                //    ContentStorage.ScoreLimit = 30;
                //    return true;
                
                case 0:
                    ContentStorage.ScoreLimit = 10;
                    return true;
                case 1:
                    ContentStorage.ScoreLimit = 15;
                    return true;
                case 2:
                    ContentStorage.ScoreLimit = 20;
                    return true;
                case 3:
                    ContentStorage.ScoreLimit = 30;
                    return true;
                default:
                    return false;
            }

        }

        protected override void Exit()
        {
            if (!toNextMenu)
            {
                PaddleSelectionScreen paddleSel = (PaddleSelectionScreen)screenManager.GetScreen("paddleSelectionScreen");
                paddleSel.CurrentPlayerSelecting = 1;
            }
            base.Exit();
        }
        #endregion
        
    }
}
